

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/hh1247857703/BlogOfHH.git/img/favicon.png">
  <link rel="icon" href="/hh1247857703/BlogOfHH.git/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="HH">
  <meta name="keywords" content="">
  
    <meta name="description" content="数据库创建两张表:exception_log、operation_logexception_log.sql 1234567891011121314CREATE TABLE &#96;exception_log&#96;  (  &#96;exc_id&#96; varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT &amp;#x27;主">
<meta property="og:type" content="article">
<meta property="og:title" content="使用SpringBoot AOP 记录操作日志、异常日志.md">
<meta property="og:url" content="https://gitee.com/hh1247857703/BlogOfHH.git/2022/03/31/java/%E4%BD%BF%E7%94%A8SpringBoot%20AOP%20%E8%AE%B0%E5%BD%95%E6%93%8D%E4%BD%9C%E6%97%A5%E5%BF%97%E3%80%81%E5%BC%82%E5%B8%B8%E6%97%A5%E5%BF%97/index.html">
<meta property="og:site_name" content="The Blog Of HH">
<meta property="og:description" content="数据库创建两张表:exception_log、operation_logexception_log.sql 1234567891011121314CREATE TABLE &#96;exception_log&#96;  (  &#96;exc_id&#96; varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT &amp;#x27;主">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331161701.png">
<meta property="article:published_time" content="2022-03-31T07:59:20.000Z">
<meta property="article:modified_time" content="2022-03-31T08:25:35.516Z">
<meta property="article:author" content="HH">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://gitee.com/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331161701.png">
  
  
  <title>使用SpringBoot AOP 记录操作日志、异常日志.md - The Blog Of HH</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/arta.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/hh1247857703/BlogOfHH.git/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"gitee.com","root":"/hh1247857703/BlogOfHH.git/","version":"1.8.14","typing":{"enable":true,"typeSpeed":130,"cursorChar":"💨","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":"❡"},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"baidu":17795511,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/hh1247857703/BlogOfHH.git/local-search.xml"};
  </script>
  <script  src="/hh1247857703/BlogOfHH.git/js/utils.js" ></script>
  <script  src="/hh1247857703/BlogOfHH.git/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.1.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/hh1247857703/BlogOfHH.git/">
      <strong>Smile Everyday!</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/hh1247857703/BlogOfHH.git/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331161701.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="使用SpringBoot AOP 记录操作日志、异常日志.md">
              
            </span>

            
              <div class="mt-3">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-author" aria-hidden="true"></i>
      HH
    </span>
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2022-03-31 15:59" pubdate>
        2022年3月31日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      8.4k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      70 分钟
    </span>
  

  
  
    
      <!-- 不蒜子统计文章PV -->
      <span id="busuanzi_container_page_pv" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="busuanzi_value_page_pv"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">使用SpringBoot AOP 记录操作日志、异常日志.md</h1>
            
              <p class="note note-info">
                
                  本文最后更新于：2 天前
                
              </p>
            
            <div class="markdown-body">
              <h2 id="数据库创建两张表-exception-log、operation-log"><a href="#数据库创建两张表-exception-log、operation-log" class="headerlink" title="数据库创建两张表:exception_log、operation_log"></a>数据库创建两张表:exception_log、operation_log</h2><p><strong>exception_log.sql</strong></p>
<figure class="highlight sql"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></div></td><td class="code"><pre><code class="hljs sql"><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> `exception_log`  (<br>  `exc_id` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NOT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;主键Id&#x27;</span>,<br>  `exc_req_param` text <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常请求参数&#x27;</span>,<br>  `exc_name` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常名称&#x27;</span>,<br>  `exc_message` text <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常信息&#x27;</span>,<br>  `exc_user_id` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作员Id&#x27;</span>,<br>  `exc_user_name` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作员名称&#x27;</span>,<br>  `exc_method` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常方法&#x27;</span>,<br>  `exc_uri` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常请求地址&#x27;</span>,<br>  `exc_ip` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;异常IP&#x27;</span>,<br>  `exc_version` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;版本号&#x27;</span>,<br>  `exc_create_time` datetime(<span class="hljs-number">0</span>) <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>  <span class="hljs-keyword">PRIMARY</span> KEY (`exc_id`) <span class="hljs-keyword">USING</span> BTREE<br>) ENGINE <span class="hljs-operator">=</span> InnoDB <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> <span class="hljs-operator">=</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> <span class="hljs-operator">=</span> utf8mb4_0900_ai_ci ROW_FORMAT <span class="hljs-operator">=</span> <span class="hljs-keyword">Dynamic</span>;<br></code></pre></td></tr></table></figure>
<p><strong>operation_log.sql</strong></p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs sql"><span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span> `operation_log`  (<br>  `oper_id` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NOT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;主键ID&#x27;</span>,<br>  `oper_modul` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;功能模块&#x27;</span>,<br>  `oper_type` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作类型&#x27;</span>,<br>  `oper_desc` <span class="hljs-type">varchar</span>(<span class="hljs-number">500</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作描述&#x27;</span>,<br>  `oper_req_param` text <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;请求参数&#x27;</span>,<br>  `oper_resp_param` text <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;响应参数&#x27;</span>,<br>  `oper_user_id` <span class="hljs-type">varbinary</span>(<span class="hljs-number">64</span>) <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作员Id&#x27;</span>,<br>  `oper_user_name` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作员名称&#x27;</span>,<br>  `oper_method` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作方法&#x27;</span>,<br>  `oper_uri` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作地址&#x27;</span>,<br>  `oper_ip` <span class="hljs-type">varchar</span>(<span class="hljs-number">255</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;操作IP&#x27;</span>,<br>  `oper_create_time` datetime(<span class="hljs-number">0</span>) <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;创建时间&#x27;</span>,<br>  `oper_version` <span class="hljs-type">varchar</span>(<span class="hljs-number">64</span>) <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> utf8mb4_0900_ai_ci <span class="hljs-keyword">NULL</span> <span class="hljs-keyword">DEFAULT</span> <span class="hljs-keyword">NULL</span> COMMENT <span class="hljs-string">&#x27;版本号&#x27;</span>,<br>  <span class="hljs-keyword">PRIMARY</span> KEY (`oper_id`) <span class="hljs-keyword">USING</span> BTREE<br>) ENGINE <span class="hljs-operator">=</span> InnoDB <span class="hljs-type">CHARACTER</span> <span class="hljs-keyword">SET</span> <span class="hljs-operator">=</span> utf8mb4 <span class="hljs-keyword">COLLATE</span> <span class="hljs-operator">=</span> utf8mb4_0900_ai_ci ROW_FORMAT <span class="hljs-operator">=</span> <span class="hljs-keyword">Dynamic</span>;<br></code></pre></td></tr></table></figure>

<h2 id="添加Maven依赖"><a href="#添加Maven依赖" class="headerlink" title="添加Maven依赖"></a>添加Maven依赖</h2><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-comment">&lt;!-- SpringAop  --&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">dependency</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">groupId</span>&gt;</span>org.springframework.boot<span class="hljs-tag">&lt;/<span class="hljs-name">groupId</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">artifactId</span>&gt;</span>spring-boot-starter-aop<span class="hljs-tag">&lt;/<span class="hljs-name">artifactId</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">dependency</span>&gt;</span><br></code></pre></td></tr></table></figure>

<h2 id="创建操作日志注解类-OperLog-java"><a href="#创建操作日志注解类-OperLog-java" class="headerlink" title="创建操作日志注解类:OperLog.java"></a>创建操作日志注解类:OperLog.java</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> java.lang.annotation.*;<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 操作日志自定义注解</span><br><span class="hljs-comment"> */</span><br><span class="hljs-meta">@Target(ElementType.METHOD)</span>             <span class="hljs-comment">//注解放置的目标位置,METHOD是可注解在方法级别上</span><br><span class="hljs-meta">@Retention(RetentionPolicy.RUNTIME)</span>     <span class="hljs-comment">//注解在哪个阶段执行</span><br><span class="hljs-meta">@Documented</span><br><span class="hljs-keyword">public</span> <span class="hljs-meta">@interface</span> OperLog &#123;<br>    String <span class="hljs-title function_">operModul</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> <span class="hljs-string">&quot;&quot;</span>;      <span class="hljs-comment">// 操作模块</span><br>    String <span class="hljs-title function_">operType</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> <span class="hljs-string">&quot;&quot;</span>;       <span class="hljs-comment">// 操作类型</span><br>    String <span class="hljs-title function_">operDesc</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> <span class="hljs-string">&quot;&quot;</span>;       <span class="hljs-comment">// 操作描述</span><br>&#125;<br></code></pre></td></tr></table></figure>

<h2 id="创建切面类记录操作日志：OperLogAspect-java"><a href="#创建切面类记录操作日志：OperLogAspect-java" class="headerlink" title="创建切面类记录操作日志：OperLogAspect.java"></a>创建切面类记录操作日志：OperLogAspect.java</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> com.alibaba.fastjson.JSON;<br><span class="hljs-keyword">import</span> com.hh.core.log.entity.ExceptionLog;<br><span class="hljs-keyword">import</span> com.hh.core.log.entity.OperationLog;<br><span class="hljs-keyword">import</span> com.hh.core.log.service.IExceptionLogService;<br><span class="hljs-keyword">import</span> com.hh.core.log.service.IOperationLogService;<br><span class="hljs-keyword">import</span> lombok.extern.slf4j.Slf4j;<br><span class="hljs-keyword">import</span> org.aspectj.lang.JoinPoint;<br><span class="hljs-keyword">import</span> org.aspectj.lang.annotation.AfterReturning;<br><span class="hljs-keyword">import</span> org.aspectj.lang.annotation.AfterThrowing;<br><span class="hljs-keyword">import</span> org.aspectj.lang.annotation.Aspect;<br><span class="hljs-keyword">import</span> org.aspectj.lang.annotation.Pointcut;<br><span class="hljs-keyword">import</span> org.aspectj.lang.reflect.MethodSignature;<br><span class="hljs-keyword">import</span> org.springframework.beans.factory.annotation.Autowired;<br><span class="hljs-keyword">import</span> org.springframework.stereotype.Component;<br><span class="hljs-keyword">import</span> org.springframework.web.context.request.RequestAttributes;<br><span class="hljs-keyword">import</span> org.springframework.web.context.request.RequestContextHolder;<br><span class="hljs-keyword">import</span> javax.servlet.http.HttpServletRequest;<br><span class="hljs-keyword">import</span> java.lang.reflect.Method;<br><span class="hljs-keyword">import</span> java.time.LocalDateTime;<br><span class="hljs-keyword">import</span> java.util.HashMap;<br><span class="hljs-keyword">import</span> java.util.Map;<br><span class="hljs-keyword">import</span> java.util.UUID;<br><br><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@author</span> Smile</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@version</span> 1.0</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@description</span>: 切面处理类，操作日志异常日志记录处理</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@date</span> 2022/3/30 10:54</span><br><span class="hljs-comment"> */</span><br><span class="hljs-meta">@Aspect</span><br><span class="hljs-meta">@Component</span><br><span class="hljs-meta">@Slf4j</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">OperLogAspect</span> &#123;<br>    <span class="hljs-meta">@Autowired</span><br>    <span class="hljs-keyword">private</span> IOperationLogService logService;<br>    <span class="hljs-meta">@Autowired</span><br>    <span class="hljs-keyword">private</span> IExceptionLogService exceptionLogService;<br><br>    <span class="hljs-keyword">private</span> Method method;<br>    <span class="hljs-keyword">private</span> String requestMethod;<br>    <span class="hljs-keyword">private</span> String requestURI;<br>    <span class="hljs-keyword">private</span> String paramterJson;<br><br>    <span class="hljs-comment">/**</span><br><span class="hljs-comment">    *   操作版本号</span><br><span class="hljs-comment">    *   项目启动时从命令行传入，例如：java -jar xxx.war --version=201902</span><br><span class="hljs-comment">    */</span><br>    <span class="hljs-meta">@Value(&quot;$&#123;version&#125;&quot;)</span><br>    <span class="hljs-keyword">private</span> String operVersion;<br><br>    <span class="hljs-meta">@Pointcut(&quot;@annotation(com.hh.core.log.OperLog)&quot;)</span>     <span class="hljs-comment">// 设置操作日志切入点 记录操作日志 在注解的位置切入代码</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">operLogPointCut</span><span class="hljs-params">()</span> &#123;<br>    &#125;<br><br>    <span class="hljs-meta">@Pointcut(&quot;execution (* com.hh.core.controller..*.*(..))&quot;)</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">operExceptionPointCut</span><span class="hljs-params">()</span> &#123;<br>    &#125;<br><br>    <span class="hljs-comment">/**</span><br><span class="hljs-comment">    * 正常返回通知，拦截用户操作日志，连接点正常执行完成后执行， 如果连接点抛出异常，则不会执行</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> joinPoint 切入点</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> keys      返回结果</span><br><span class="hljs-comment">    */</span><br>    <span class="hljs-meta">@AfterReturning(value = &quot;operLogPointCut()&quot;, returning = &quot;keys&quot;)</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">saveOperLog</span><span class="hljs-params">(JoinPoint joinPoint, Object keys)</span> &#123;<br>        getRequestInfo(joinPoint, keys, <span class="hljs-literal">null</span>);<br>        <span class="hljs-type">OperLog</span> <span class="hljs-variable">annotation</span> <span class="hljs-operator">=</span> method.getAnnotation(OperLog.class);<br><br>        <span class="hljs-type">String</span> <span class="hljs-variable">operModul</span> <span class="hljs-operator">=</span> annotation.operModul();<br>        <span class="hljs-type">String</span> <span class="hljs-variable">operType</span> <span class="hljs-operator">=</span> annotation.operType();<br>        <span class="hljs-type">String</span> <span class="hljs-variable">operDesc</span> <span class="hljs-operator">=</span> annotation.operDesc();<br><br>        <span class="hljs-type">OperationLog</span> <span class="hljs-variable">operationLog</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">OperationLog</span>();<br>        operationLog.setOperId(UUID.randomUUID().toString());<br>        operationLog.setOperModul(operModul);<br>        operationLog.setOperType(operType);<br>        operationLog.setOperDesc(operDesc);<br>        operationLog.setOperUri(requestURI);<br>        operationLog.setOperMethod(requestMethod);<br>        operationLog.setOperReqParam(paramterJson);<br>        operationLog.setOperRespParam(keys.toString());<br>        operationLog.setOperCreateTime(LocalDateTime.now());<br>        operationLog.setOperVersion(operVersion);<br><br>        logService.save(operationLog);<br>    &#125;<br><br>    <span class="hljs-comment">/**</span><br><span class="hljs-comment">    * 异常返回通知，用于拦截异常日志信息 连接点抛出异常后执行</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> joinPoint 切入点</span><br><span class="hljs-comment">    * <span class="hljs-doctag">@param</span> e 异常信息</span><br><span class="hljs-comment">    */</span><br>    <span class="hljs-meta">@AfterThrowing(value = &quot;operExceptionPointCut()&quot;, throwing  = &quot;e&quot;)</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">saveExceptionLog</span><span class="hljs-params">(JoinPoint joinPoint, Throwable e)</span> &#123;<br>        getRequestInfo(joinPoint, <span class="hljs-literal">null</span>, e);<br>        <span class="hljs-type">ExceptionLog</span> <span class="hljs-variable">exceptionLog</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">ExceptionLog</span>();<br>        exceptionLog.setExcId(UUID.randomUUID().toString());<br>        exceptionLog.setExcUri(requestURI);<br>        exceptionLog.setExcReqParam(paramterJson);<br>        exceptionLog.setExcMethod(requestMethod);<br>        exceptionLog.setExcName(e.getClass().getName());<br>        exceptionLog.setExcMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace()));<br>        exceptionLog.setExcVersion(operVersion);<br>        exceptionLog.setExcCreateTime(LocalDateTime.now());<br>        exceptionLogService.save(exceptionLog);<br>    &#125;<br><br>    <span class="hljs-keyword">private</span> Map&lt;String, String&gt; <span class="hljs-title function_">coverMap</span><span class="hljs-params">(Map&lt;String, String[]&gt; parameterMap)</span> &#123;<br>        <span class="hljs-type">Map</span> <span class="hljs-variable">rtnMap</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;String, String&gt;();<br>        <span class="hljs-keyword">for</span> (String key : parameterMap.keySet()) &#123;<br>            rtnMap.put(key, parameterMap.get(key)[<span class="hljs-number">0</span>]);<br>        &#125;<br>        <span class="hljs-keyword">return</span> rtnMap;<br>    &#125;<br><br>    <span class="hljs-comment">/**</span><br><span class="hljs-comment">     * 转换异常信息为字符串</span><br><span class="hljs-comment">     *</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> exceptionName    异常名称</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> exceptionMessage 异常信息</span><br><span class="hljs-comment">     * <span class="hljs-doctag">@param</span> elements         堆栈信息</span><br><span class="hljs-comment">     */</span><br>    <span class="hljs-keyword">public</span> String <span class="hljs-title function_">stackTraceToString</span><span class="hljs-params">(String exceptionName, String exceptionMessage, StackTraceElement[] elements)</span> &#123;<br>        <span class="hljs-type">StringBuffer</span> <span class="hljs-variable">strbuff</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">StringBuffer</span>();<br>        <span class="hljs-keyword">for</span> (StackTraceElement stet : elements) &#123;<br>            strbuff.append(stet + <span class="hljs-string">&quot;\n&quot;</span>);<br>        &#125;<br>        <span class="hljs-type">String</span> <span class="hljs-variable">message</span> <span class="hljs-operator">=</span> exceptionName + <span class="hljs-string">&quot;:&quot;</span> + exceptionMessage + <span class="hljs-string">&quot;\n\t&quot;</span> + strbuff.toString();<br>        <span class="hljs-keyword">return</span> message;<br>    &#125;<br><br>    <span class="hljs-comment">/*</span><br><span class="hljs-comment">    * 获取一些请求和访问的信息，如请求的Uri，参数，请求的方法等</span><br><span class="hljs-comment">    */</span><br>    <span class="hljs-keyword">private</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">getRequestInfo</span><span class="hljs-params">(JoinPoint joinPoint, Object keys, Throwable e)</span> &#123;<br>        <span class="hljs-comment">// 获取RequestAttributes，从而去获取HttpServletRequest</span><br>        <span class="hljs-type">RequestAttributes</span> <span class="hljs-variable">attributes</span> <span class="hljs-operator">=</span> RequestContextHolder.getRequestAttributes();<br>        <span class="hljs-type">HttpServletRequest</span> <span class="hljs-variable">req</span> <span class="hljs-operator">=</span> (HttpServletRequest) attributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);<br><br>        <span class="hljs-comment">// 从切面织入点处通过反射机制获取织入点处的方法</span><br>        <span class="hljs-type">MethodSignature</span> <span class="hljs-variable">signature</span> <span class="hljs-operator">=</span> (MethodSignature) joinPoint.getSignature();<br>        method = signature.getMethod();<br>        requestMethod = joinPoint.getTarget().getClass().getName() + <span class="hljs-string">&quot;.&quot;</span> + method.getName();<br>        requestURI = req.getRequestURI();<br>        Map&lt;String, String&gt; map = coverMap(req.getParameterMap());<br>        paramterJson = JSON.toJSONString(map);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<h2 id="在请求的controller方法上添加注解：-OperLog-operModul-x3D-”xxx”-operType-x3D-”xxx”-operDesc-x3D-”xxxx”"><a href="#在请求的controller方法上添加注解：-OperLog-operModul-x3D-”xxx”-operType-x3D-”xxx”-operDesc-x3D-”xxxx”" class="headerlink" title="在请求的controller方法上添加注解：@OperLog(operModul&#x3D;”xxx”,operType&#x3D;”xxx”,operDesc&#x3D;”xxxx”)"></a>在请求的controller方法上添加注解：@OperLog(operModul&#x3D;”xxx”,operType&#x3D;”xxx”,operDesc&#x3D;”xxxx”)</h2><p><img src="/hh1247857703/BlogOfHH.git/img/article/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20220331161701.png" srcset="/hh1247857703/BlogOfHH.git/img/loading/loading.gif" lazyload></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/">编程</a>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/Java/">Java</a>
                    
                      <a class="hover-with-bg" href="/hh1247857703/BlogOfHH.git/categories/%E7%BC%96%E7%A8%8B/Java/Spring/">Spring</a>
                    
                  </div>
                
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/hh1247857703/BlogOfHH.git/2022/03/31/java/%E7%BB%9F%E4%B8%80%E7%BB%93%E6%9E%9C%E8%BF%94%E5%9B%9E/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">统一结果返回.md</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/hh1247857703/BlogOfHH.git/2022/03/31/java/EasyExcel%E4%B8%8E@Accessors(chain%20=%20true)%E4%B8%8D%E5%85%BC%E5%AE%B9%E5%88%86%E6%9E%90/">
                        <span class="hidden-mobile">转载文章 -- EasyExcel与@Accessors(chain = true)不兼容分析.md</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"YNaQpUHmK70UWg4eAuxASf1T-gzGzoHsz","appKey":"e0uHoSbv8bBD5Jruur36RDvW","path":"window.location.pathname","placeholder":null,"avatar":"robohash","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          Fluid.plugins.initFancyBox('#valine .vcontent img:not(.vemoji)');
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>本网站使用Fluid主题</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/hh1247857703/BlogOfHH.git/js/events.js" ></script>
<script  src="/hh1247857703/BlogOfHH.git/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/hh1247857703/BlogOfHH.git/js/local-search.js" ></script>



  
    <script  src="/hh1247857703/BlogOfHH.git/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>












  
    <!-- Baidu Analytics -->
    <script defer>
      var _hmt = _hmt || [];
      (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?17795511";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  

  

  

  

  

  





<!-- 主题的启动项 保持在最底部 -->
<script  src="/hh1247857703/BlogOfHH.git/js/boot.js" ></script>


</body>
</html>
